package com.witsight.platform.filter;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.spi.Filter;

import com.witsight.platform.util.lang.CollectionUtil;
import com.witsight.platform.util.lang.StringUtil;

/**   
 * 说明：切面日志过滤
 * @Title: LogFilter.java 
 * @Package com.witsight.platform.filter 
 * @See: #Filter<br/>
 * Copyright: Copyright (c) 2017<br/>
 * Company:sany huax witsight team by product
 * @author: penght  
 * @date: 2017年10月31日 上午8:49:53 
 * @version: V1.0
 *
 */
public class AspectLogFilter extends Filter {
	private String className;
	
	private List<String> classNames = new ArrayList<>();
	
	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
		this.classNames = CollectionUtil.arrayToList( StringUtil.commaDelimitedListToStringArray(className));
	}

//	public int decide(LoggingEvent event) {
//		LocationInfo locationInfo = event.getLocationInformation();
//		if (CollectionUtil.isNotEmpty(this.classNames) && 
//				this.classNames.contains(locationInfo.getClassName())) {
//			return ACCEPT;
//		}
//		return DENY;
//	}
}
